package br.com.Orange.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateUtil {
	
	private static SessionFactory factory;
	
	static{
		AnnotationConfiguration cfg = new AnnotationConfiguration();
		cfg.configure("br/com/Orange/hibernate/hibernate.cfg.xml");
		factory = cfg.buildSessionFactory();
	}

	public static Session getSession(){
		return factory.openSession();
	}	
	
}
